package com.ydzc.mapper;

import com.ydzc.domain.ShareInfo;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;
@RepositoryRestResource(collectionResourceRel = "shareInfo", path = "shareInfo")
public interface ShareInfoRepository extends MongoRepository<ShareInfo, String> {
    //查询用户分享的链接信息
    List<ShareInfo> findByShareOpenId(@Param("shareOpenId") String shareOpenId);

    //查询商品分享的链接
    List<ShareInfo> findByShareGoodsId(@Param("shareGoodsId")String shareGoodsId);

    //按商品名称查询分享的链接
    List<ShareInfo> findByShareGoodsName(@Param("shareGoodsName")String shareGoodsName);

    //根据用户编号和商品编号查询分享链接
    List<ShareInfo> findByShareOpenIdAndShareGoodsId(@Param("shareOpenId")String shareOpenId, @Param("shareGoodsId")String shareGoodsId);


}
